﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace JTLeigh.Commerce.Spencer.Features.ProductImages.Service.Contracts.Runtime.GetProductImages
{

	/// <summary>
	/// Data contract representing a single view of a product.
	/// </summary>
	/// <remarks>
	/// <para>
	/// A single view (e.g. &quot;Front View&quot;) may have multiple variants representing 
	/// different sizes (e.g. &quot;Small Front View&quot;, &quot;Medium Front View&quot;,
	/// &quot;Large Front View&quot;, etc).
	/// </para>
	/// </remarks>
    [DataContract(Name = "ProductImage", Namespace = "http://schemas.jtleigh.com/Commerce/Spencer/Features/ProductImages/1.0/Runtime/GetProductImages/")]
    public class ProductImage
	{

		/// <summary>
		/// Gets or sets the view identifier.
		/// </summary>
		/// <value>A view identifier <see cref="Guid"/>.</value>
		[DataMember(Name = "ViewId", IsRequired = true)]
		public Guid ViewId { get; set; }

		/// <summary>
		/// Gets or sets the alternative text that should be displayed in place of the image.
		/// </summary>
		[DataMember(Name = "AlternativeText", IsRequired = false)]
		public string AlternativeText { get; set; }

		/// <summary>
		/// Gets or sets the usage permission text that should be attached to the image.
		/// </summary>
		[DataMember(Name = "UsagePermissionText", IsRequired = false)]
		public string UsagePermissionText { get; set; }

		/// <summary>
		/// Gets or sets a dictionary of the variants of the image.
		/// </summary>
		/// <value>An <see cref="IDictionary{TKey,TValue}"/> of <see cref="ProductImageVariant"/> 
		/// keyed by size identifier <see cref="Guid"/>.</value>
		[DataMember(Name = "Variants", IsRequired = false)]
		public IDictionary<Guid, ProductImageVariant> Variants { get; set; }

	}

}
